import java.util.Scanner;

public class HJ50 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int len = sc.nextInt();
            int[] ints = new int[len];
            for(int i = 0; i < len; ++i){
                ints[i] = sc.nextInt();
            }
            int num = sc.nextInt();
            if(num == 0){ //为什么是这种特殊情况啊
                System.out.println(0);
            }else{
                System.out.println(ints[len - num]);
            }

        }
    }
}
